package net.uman.framework.modules.search;

import java.io.File;

public class SearchFactory {
	private static File root = null;
	private static String host = "localhost";
	private static int port = 27017;
	
	private static Search search;
	
	public static synchronized Search getSearch() {
		if (search == null) {
//			search = new MongoDbSearch(host, port);
			search = new LuceneSearch(root);
//			search = new AllSearch(new LuceneSearch(root), new MongoDbSearch(host, port));
		}
		return search;
	}

	public static File getRoot() {
		return root;
	}

	public static void setRoot(File root) {
		SearchFactory.root = root;
	}

	public static String getHost() {
		return host;
	}

	public static void setHost(String host) {
		SearchFactory.host = host;
	}

	public static int getPort() {
		return port;
	}

	public static void setPort(int port) {
		SearchFactory.port = port;
	}
}
